﻿using System;
using System.Windows.Media.Imaging;

namespace Gonte.Wpf.Controls.ViewModel
{
    public abstract class TreeViewFolderViewModel
        : ViewModelBase
    {
        #region Read Only

        internal static readonly BitmapImage OpenFolder = new BitmapImage(new Uri(@"pack://application:,,/Images/OpenFolder.bmp"));
        internal static readonly BitmapImage ClosedFolder = new BitmapImage(new Uri(@"pack://application:,,/Images/ClosedFolder.bmp"));

        #endregion

        #region Constructors

        public TreeViewFolderViewModel(ViewModelBase parent, String label)
            : base(parent, false)
        {
            label_ = label;
            IconSource = ClosedFolder;
        } 

        #endregion

        #region Overridables

        public override String Label
        {
            get { return label_; }
        }

        protected override void UpdateIconSource()
        {
            if (IsExpanded)
            {
                IconSource = OpenFolder;
            }
            else
            {
                IconSource = ClosedFolder;
            }
        }

        public override Object Model
        {
            get
            {
                return null;
            }

            set
            {
                throw new NotImplementedException();
            }
        }

 
        public override void OnPropertyChanged(String propertyName, Object oldValue)
        {
            // Do nothing
            //throw new NotImplementedException();
        }

        public override int CompareTo(Object @object)
        {
            throw new NotImplementedException();
        } 

        #endregion

        #region Fields

        private String label_; 

        #endregion
    }
}
